CC = gcc
CFLAGS = -Wall -Wextra -ansi -pedantic -O3
LIBS = -lxnet -lsocket

all: ftps ftpc tcpd
ftps: ftps.c api.o protocol.h
	$(CC) $(CFLAGS) $(LIBS) api.o -o $@ ftps.c
ftpc: ftpc.c api.o protocol.h
	$(CC) $(CFLAGS) $(LIBS) api.o -o $@ ftpc.c
tcpd: tcpd.c storage.c protocol.h storage.h
	$(CC) $(CFLAGS) -DDEBUG $(LIBS) -lpthread -lrt storage.c -o $@ tcpd.c

%.o: %.c
	$(CC) $(CFLAGS) -c $^
clean:
	$(RM) *.o ftps ftpc tcpd

